package com.snow.auth.entity;

import com.snow.jpa.IBaseEntity;
import com.snow.jpa.ICreateInfoEntity;
import com.snow.jpa.ITenantEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 部门
 *
 * @author by 13119
 */
@Getter
@Setter
@Entity
public class SystemDept implements Serializable, IBaseEntity<Integer>, ITenantEntity, ICreateInfoEntity {
    @Id
    @GeneratedValue(strategy = IDENTITY)
    private Integer id;
    /**
     * 父级ID
     */
    private Integer parentId;
    /**
     * 部门名称
     */
    private String deptName;
    /**
     * 排序
     */
    private Integer sort;
    private Integer createId;
    private String createName;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 0 锁定
     * 1 正常
     */
    private Integer status;
    private Integer tenantId;
    @Transient
    private List<SystemDept> children;

}
